package com.lcf.system.controller;


import com.lcf.framework.vo.PageVO;
import com.lcf.system.dto.MovieCommentDTO;
import com.lcf.system.query.MovieCommentPageQuery;
import com.lcf.system.service.MovieCommentService;
import com.lcf.system.vo.MovieCommentVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 评论(MovieComment)表控制层
 *
 * @author lcf
 * @since 2025-05-07 22:23:22
 */
@Tag(name = "评论")
@RestController
@RequestMapping("movieComment")
public class MovieCommentController {
    @Resource
    private MovieCommentService movieCommentService;

    /**
     * 评论电影
     */
    @Operation(summary = "评论电影")
    @PostMapping("comment")
    void comment(@RequestBody@Validated MovieCommentDTO dto) {
        movieCommentService.comment(dto);
    }
    /**
     * 删除评论
     */
    @Operation(summary = "删除评论")
    @DeleteMapping("delete/{id}")
    void delete(@PathVariable@Schema(description = "评论ID") Long id) {
        movieCommentService.delete(id);
    }
    /**
     * 电影评论分页
     */
    @Operation(summary = "电影评论分页")
    @GetMapping("page")
    PageVO<MovieCommentVO> page(MovieCommentPageQuery query) {
        return movieCommentService.page(query);
    }
}

